home *** CD-ROM | disk | FTP | other *** search
- *** 1.2 1992/03/28 07:16:50
- --- PatchLev.h 1992/04/19 17:07:01
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "02"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "03"
-
- /*
- *
- *** 1.1 1992/03/26 21:49:31
- --- tprintf.c 1992/04/19 17:07:02
- ***************
- *** 19,28 ****
- --- 19,30 ----
- #include "ansidecl.h"
- #ifdef BSD
- #include </usr/include/stdio.h>
- + #include <strings.h>
- #define EXIT_SUCCESS 0
- #else
- #include <stdio.h>
- #include <stdlib.h>
- + #include <string.h>
- #endif
-
-
- ***************
- *** 53,58 ****
- --- 55,89 ----
- (void) printf("'\n");
- }
-
- + typedef struct {
- + char *str;
- + unsigned long data;
- + } DATA;
- +
- + static DATA dat[] = {
- + {"1", 1},
- + {"2", 2},
- + {"65535", 65535},
- + {"65536", 65536},
- + {"70000", 70000},
- + {"1289823", 1289823},
- + {"2147483647", 0x7fffffffL},
- + {"4294967295", 0xffffffffL},
- + {"0", 0},
- + {0, 0}
- + };
- +
- + void
- + DEFUN_VOID(test_print_unsigned_longs)
- + {
- + DATA *d = dat;
- +
- + for(; d->str; d++) {
- + printf("Length of \"%s\" is %lu Value is %lu\n",
- + d->str, strlen(d->str), d->data);
- + }
- + }
- +
- int
- DEFUN_VOID(main)
- {
- ***************
- *** 127,132 ****
- --- 158,166 ----
- snprintf (buf, sizeof (buf), "%30s", "foo"), sizeof (buf), buf);
- }
- #endif
- +
- + /* more tests ++jrb */
- + test_print_unsigned_longs();
-
- return(EXIT_SUCCESS);
- }
- *** 1.1 1992/03/26 21:49:31
- --- tprintf.out 1992/04/19 17:07:03
- ***************
- *** 47,49 ****
- --- 47,58 ----
- | 12345.0000| 1.2345e+04| 1.235e+04|
- | 100000.0000| 1.0000e+05| 1e+05|
- | 123456.0000| 1.2346e+05| 1.235e+05|
- + Length of "1" is 1 Value is 1
- + Length of "2" is 1 Value is 2
- + Length of "65535" is 5 Value is 65535
- + Length of "65536" is 5 Value is 65536
- + Length of "70000" is 5 Value is 70000
- + Length of "1289823" is 7 Value is 1289823
- + Length of "2147483647" is 10 Value is 2147483647
- + Length of "4294967295" is 10 Value is 4294967295
- + Length of "0" is 1 Value is 0
-